Skip to content

Conversation

@LembituNN
Copy link
Contributor

This adds universal LDMA handler.
Before only logger could use LDMA now through this handler any application is able to interface with LDMA.

… only be 1.

Modified logger-ldma to use universal handler.
Seems that logger_ldma is expecting some other flag to function properly.
Currently unable to fix logger_ldma myself (Lembitu).
Went with easier approach letting logger_ldma to accept both flags. Currently seems to work.
TODO: make actual fix
#define SIZE_OF_ARRAY(arr) (sizeof(arr))/sizeof(arr[0])

static volatile ldma_handler_conf_t m_head;
static volatile ldma_handler_conf_t m_head = {0xFF, NULL, 0, 0, NULL};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use structre members names to initialize them e.g. const osThreadAttr_t app_thread_attr = { .name = "app" };

while(ptr != NULL)
{
if ( pending & (1<<ptr->channel) )
if ( pending & (1 << ptr->channel) )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BARR - remove spaces if ((pending & (1 << ptr->channel)))



ldma_handler_conf_t* ptr = &m_head;
while(ptr != NULL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BARR - add space

{
if ( pending & (1<<ptr->channel) )
if ( pending & (1 << ptr->channel) )
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identation - open all files in editor and convert tabs to spaces and check after that the indentation is correct

Copy link
Contributor

@Madis242 Madis242 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BARR

m_ldma_handler_conf.signal = LOGGER_THREAD_FLAG_LDMA_DONE;
m_ldma_handler_conf.thrd = &m_ldma_thread;
m_ldma_handler_conf.thrd = m_ldma_thread;
m_ldma_handler_conf.name = 69;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use constants instead of mystical numbers. e.g. #define DEFAULT_CONF_NAME 69

@raidoz
Copy link
Member

raidoz commented Mar 3, 2022

This looks to duplicate functionality already provided by dmadrv.h ... which the logger already supports. dmadrv.h is also used by DALI and smenete microphones/microwave and there they all work together merrily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants